package service;

import com.service.IHello;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;

/**
 * @description:
 * @author: lipy
 * @create: 2020-08-30 10:25
 **/

public class RmiLookup {
    public static void main(String[] args) throws RemoteException, NotBoundException, MalformedURLException {
        Remote rmiHello = Naming.lookup("rmi://127.0.0.1:8080/rimHello");
        IHello hello = (com.service.IHello)rmiHello;
        String aaa = hello.sayHello("aaa");
        System.out.println("client receive aaa = " + aaa);

    }
}
